var component = require("../common/component"), transitionMixin = require("../mixins/transition"), safeAreaMixin = require("../mixins/safe-area");

(0, component.VantComponent)({
    classes: [ "enter-class", "enter-active-class", "enter-to-class", "leave-class", "leave-active-class", "leave-to-class" ],
    mixins: [ (0, transitionMixin.transition)(!1), (0, safeAreaMixin.safeArea)() ],
    props: {
        transition: {
            type: String,
            observer: "observeClass"
        },
        customStyle: String,
        overlayStyle: String,
        zIndex: {
            type: Number,
            value: 100
        },
        overlay: {
            type: Boolean,
            value: !0
        },
        closeOnClickOverlay: {
            type: Boolean,
            value: !0
        },
        position: {
            type: String,
            value: "center",
            observer: "observeClass"
        }
    },
    created: function() {
        this.observeClass();
    },
    methods: {
        onClickOverlay: function() {
            this.$emit("click-overlay"), this.data.closeOnClickOverlay && this.$emit("close");
        },
        observeClass: function() {
            var componentData = this.data, transitionName = componentData.transition, positionType = componentData.position;
            this.updateClasses(transitionName || positionType), "none" === transitionName && this.set({
                duration: 0
            });
        }
    }
});